POV-Ray : Newsgroups : povray.general : How can I shift the image plane? : How can I shift the image plane? Server Time
19 Nov 2024 05:33:27 EST (-0500)
  How can I shift the image plane?  
From: Vic
Date: 26 Apr 2002 18:01:12
Message: <3cc9ce28@news.povray.org>
Hi Pov fans!

I've made a shutter glass interface hardware and created some stereo
pictures with PovRay. I'm faced with a serious shortage of Pov, namely the
unability to "shift" the camera viewport. The right and up vectors are
always at 0.5, so I've to shift the resulting images after rendering to
match the left and right eye views at the screen plane. (see "The
perspective camera" in Pov help at "Placing the Camera" topic)

Is there any way to shift the image plane during the rendering process?

Important: The shift operation is not equivalent with camera translation. I
cannot use ortographic camera, because stereo rendering is theoretically
based on the perspective one.

>>> My scene:

#version 3.5;

#include "colors.inc"
#include "math.inc"

global_settings {
  assumed_gamma 1.0
  max_trace_level 5
}

// ----------------------------------------

camera {
  #local pp=clock*2-1;
  #local dd=0.06;
  #local xx=-dd*0.5*pp;
  #local yy=0.4;
  #local zz=0.6;
  location  <xx, yy, -zz>
  right     x*image_width/image_height
  look_at   <xx, 0.0,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.0,0.2>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------

union {
  intersection {
    plane {               // checkered floor
      y, 0
      texture
      {
        pigment {
          checker
          color rgb 1
          color blue 1
          scale 0.2
        }
        finish{
          diffuse 0.8
          ambient 0.1
        }
      }
    }
    cylinder {
      <0,-0.03,0>, <0,0.01,0>, 0.2
      pigment {color red 0.5}
    }
  }

  box {
    <-0.05,0.0001,-0.05>, <0.05,0.1,0.05>
    texture {
      pigment {
        color rgbft <0.1,0.9,0.1,0.5,0.2>
      }
      finish{
        diffuse 0.4
        phong 0.3
        ambient 0.2
        specular 0.1
      }
    }
    rotate 25*y
  }

  translate 0.0*z
}

>>> Render with these settings (quickres.ini):

[1024x768, AA 0.3 Stereo]
Width=1024
Height=768
Antialias=On
Initial_Frame=1
Final_Frame=2
Initial_Clock=0
Final_Clock=1
Cyclic_Animation=off

The center point of the checker pattern (the <0,0,0> point) must match on
the first and second frames (the left and right eye views). The camera can
be rotated such a way by modifying look_at to look_at <0.0, 0.0,  0.0>, but
this introduces a perspective distortion of the X axis. The images must be
shifted on the X axis by half eye-distance, but there's no way to do this in
Pov.

Sorry about my poor English.

Thanks for your help, Vic


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.